from django.urls import include, path
from rest_framework import routers

from .views import (
    WarehouseViewSet,
    LocationViewSet,
    InventoryViewSet,
    InventoryTransactionViewSet,
    InventoryCheckViewSet,
    InventoryCheckDetailViewSet
)

# 创建默认路由
router = routers.DefaultRouter()

# 注册仓库视图集
router.register(r'warehouse', WarehouseViewSet, basename='warehouse')

# 注册库位视图集
router.register(r'location', LocationViewSet, basename='location')

# 注册库存视图集
router.register(r'inventory', InventoryViewSet, basename='inventory')

# 注册库存交易记录视图集
router.register(r'transaction', InventoryTransactionViewSet, basename='transaction')

# 注册库存盘点视图集
router.register(r'inventory-check', InventoryCheckViewSet, basename='inventory-check')

# 注册库存盘点明细视图集
router.register(r'inventory-check-detail', InventoryCheckDetailViewSet, basename='inventory-check-detail')

# URL模式列表
urlpatterns = [
    # 包含所有注册的路由
    path('', include(router.urls)),
]